//
//  InfoController.m
//  通讯录
//
//  Created by dllo on 16/7/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "InfoController.h"

@interface InfoController ()

@end

@implementation InfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    UILabel *name = [[UILabel alloc]initWithFrame:CGRectMake(50, 100, 100, 50)];
    [self.view addSubview:name];
    name.font = [UIFont systemFontOfSize:17];
    name.text = self.name;
    
    UILabel *sex = [[UILabel alloc]initWithFrame:CGRectMake(150, 100, 100, 50)];
    [self.view addSubview:sex];
    sex.font = [UIFont systemFontOfSize:17];
    sex.text = self.sex;
    
    UILabel *phoneNumber = [[UILabel alloc]initWithFrame:CGRectMake(150, 150, 200, 50)];
    [self.view addSubview:phoneNumber];
    phoneNumber.font = [UIFont systemFontOfSize:17];
    phoneNumber.text = self.phoneNumber;
    
    UILabel *age = [[UILabel alloc]initWithFrame:CGRectMake(150, 200, 100, 50)];
    [self.view addSubview:age];
    age.font = [UIFont systemFontOfSize:17];
    age.text = [NSString stringWithFormat:@"%@", self.age];
    
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(150, 250, 100, 80)];
    [self.view addSubview:button];
    button.backgroundColor = [UIColor yellowColor];
    [button setTitle:@"返回" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(backTop:) forControlEvents:UIControlEventTouchUpInside];
    [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

}

- (void)backTop:(UIButton *)button
{
    [self dismissViewControllerAnimated:self completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
